Staking Contracts
1. Staker Flow
2. Staking Pool Manager Flow
Actions
Quick Summary:
- Stakers can deposit NXM and receive Staking NFTs
- Pool Managers configure products and pool parameters
- Staking periods use 91-day tranches
1. Staker Actions
-
Deposit Stake (1a)
Staker
callsdepositTo()
on StakingPool with:- Amount of NXM to stake
- Target tranche ID
- Optional existing NFT ID
(1b)
StakingPool
callsmint()
on StakingNFT (1c)StakingNFT
issues NFT to staker
-
Withdraw Stake (2a)
Staker
callswithdraw()
on StakingPool with:- NFT ID
- Tranche IDs
- Amount to withdraw
(2b)
StakingPool
callsburn()
on StakingNFT (2c)StakingPool
callswithdrawNXMStakeAndRewards()
on TokenController (2d)TokenController
callstransfer()
on NXMToken (2e)NXMToken
returns NXM + rewards to staker
-
Extend Deposit (3)
Staker
callsextendDeposit()
on StakingPool with:- NFT ID
- Source tranche ID
- Target tranche ID
- Amount to extend
2. Staking Pool Manager Actions
-
Create Pool (1a)
Manager
callscreateStakingPool()
on StakingProducts with:- Pool privacy setting
- Initial and max pool fees
- Product initialization parameters
- IPFS metadata hash
(1b)
StakingProducts
callscreate()
on StakingPoolFactory
-
Configure Products (2)
Manager
callssetProducts()
on StakingProducts with:- Product IDs
- Target weights
- Target price
-
Update Metadata (3)
Manager
callssetPoolMetadata()
on StakingProducts with:- Pool ID
- New IPFS metadata hash
Notes
- Staking periods are organized in 91-day tranches
- NFTs represent ownership of staked NXM and rewards
- Pools can be public or private
- Pool managers set product weights and pricing
- Rewards are distributed based on stake duration
- All contracts fetch latest addresses from NXMaster Registry
Registry Dependencies
All contracts fetch latest contract addresses from NXMaster:
- StakingPool: TC (TokenController), P1 (Pool), SP (StakingProducts)
- StakingProducts: TC (TokenController), PF (StakingPoolFactory), CP (CoverProducts)
- StakingNFT: Operator address